import APIClient from '../../network/index';

const  Bargain ={
    state: {
        list:[]
    },
    mutations: {
        HOME_BARGAIN(state,item){
            state.list=[...item]
        }
    },
    actions: {
        HOME_BARGAIN(context){
            APIClient.bargain().then((res)=>{
              let lists =[]
              for(let i in res.data.data.goodsMap){
                  lists.push(res.data.data.goodsMap[i])
              }
                context.commit('HOME_BARGAIN',lists)
            }).catch((error )=>{
                console.log(error)
            })
        }
    },
    modules: {
    }
}
export default Bargain